package com.adingxiong.quickstart.project.service.impl;

import com.adingxiong.quickstart.project.entity.Files;
import com.adingxiong.quickstart.project.mapper.FilesMapper;
import com.adingxiong.quickstart.project.service.IFilesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 固件更新信息 服务实现类
 * </p>
 *
 * @author xiongc
 * @since 2020-06-02
 */
@Service
public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements IFilesService {

    @Override
    public String getUrls(List<Integer> ids) {
        List<Files> list = baseMapper.selectBatchIds(ids);
        String urls = Joiner.on(",").join(
                list.stream().map(Files::getFileUrl).collect(Collectors.toList())
        );
        return urls;
    }
}
